package view;

import controller.ClientController;
import dto.Account;
import edu.vt.middleware.password.*;
import java.awt.Color;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JTextField;
import javax.swing.UIManager;

/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
/**
 *
 * @author Islam
 */
public class Register extends javax.swing.JFrame {

//    static final int MY_MINIMUM = 0;
//    static final int MY_MAXIMUM = 100;
    private Pattern pattern;
    private Matcher matcher;
    private static final String FIRST_NAME_PATTERN = "[A-Z][a-zA-Z]*";
    private static final String LAST_NAME_PATTERN = "[a-zA-z]+([ '-][a-zA-Z]+)*";
    private static final String EMAIL_PATTERN =
            "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
            + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
    boolean isValidPassord = true;
    boolean isValidFirstName = true;
    boolean isValidLasttName = true;
    boolean isValidEMail = true;
    boolean isvalidUserName = true;
    boolean isValidData = false;
    int MY_MAXIMUM;
    Thread th;
    PasswordMeter passw;

    public Register() {
        initComponents();
        passw = new PasswordMeter();

        passwordTextF.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {


                System.out.println("Focus Lost");
                validatePassword(passwordTextF.getText());
                if (!isValidPassord&&!passwordTextF.getText().isEmpty()) {

                    passwordMeter.setForeground(Color.red);
                    passwordMeter.setString("Weak");
                    MY_MAXIMUM = 60;
                    new PasswordMeter().start();
                } else {
                    if(!passwordTextF.getText().isEmpty()){
                    passwordMeter.setForeground(new Color(51, 153, 0));
                    passwordMeter.setString("Strong");
                    MY_MAXIMUM = 90;
                    new PasswordMeter().start();
                    }
                }


            }
        });
        firstNameTextF.addKeyListener(new passwordListener());
        passwordTextF.addKeyListener(new passwordListener());
        EMailTextF.addKeyListener(new passwordListener());
        userNameTextF.addKeyListener(new passwordListener());
        lastNameTextF.addKeyListener(new passwordListener());
//        dao = new DAO();
    }

    class PasswordMeter extends Thread {

        int MY_MINIMUM = 0;

        public void updateBar(int newValue) {
            passwordMeter.setValue(newValue);
            passwordMeter.setStringPainted(true);

        }

        public void run() {

            for (int i = MY_MINIMUM; i <= MY_MAXIMUM; i++) {
                updateBar(i);
                try {
                    Thread.sleep(10);
                } catch (InterruptedException ex) {
                    Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

        }
    }

    class passwordListener implements KeyListener {

        public void keyPressed(KeyEvent e) {
            JTextField source = (JTextField) e.getSource();
            if (source.equals(firstNameTextF)) {
                firstNameLabel.setForeground(Color.BLACK);
            }
            if (source.equals(lastNameTextF)) {
                lastNameLabel.setForeground(Color.BLACK);
            }
            if (source.equals(passwordTextF)) {
                //UIManager.put("passwordMeter.selectionForeground",Color.WHITE);
                //UIManager.put("passwordMeter.foreground", Color.red);
//                passwordMeter.setValue(passwordTextF.getPassword().length);

                passwordLabel.setForeground(Color.BLACK);
            }
            if (source.equals(userNameTextF)) {
                userNameLabel.setForeground(Color.BLACK);
            }
            if (source.equals(EMailTextF)) {
                EMailLabel.setForeground(Color.BLACK);
                EmailWarningLabel.setText("");

            }




        }

        public void keyReleased(KeyEvent e) {
        }

        public void keyTyped(KeyEvent e) {
        }
    }

    public boolean validateFirstName(String nameFromForm) {
        isValidFirstName = true;
        pattern = pattern.compile(FIRST_NAME_PATTERN);
        matcher = pattern.matcher(nameFromForm);
        if (!matcher.matches()) {
            isValidFirstName = false;
        }
        return isValidFirstName;
    }

    public boolean validateLastName(String nameFromForm) {
        isValidLasttName = true;
        pattern = pattern.compile(LAST_NAME_PATTERN);
        matcher = pattern.matcher(nameFromForm);
        if (!matcher.matches()) {
            isValidLasttName = false;
        }
        return isValidLasttName;
    }

    public boolean validateEmail(String mailFromForm) {
        isValidEMail = true;
        pattern = Pattern.compile(EMAIL_PATTERN);
        matcher = pattern.matcher(mailFromForm);
        if (!matcher.matches()) {
            isValidEMail = false;
        }
        return isValidEMail;
    }

    public boolean ValideUserName(String name) {
        isvalidUserName = true;
        if ("".equals(name)) {
            isvalidUserName = false;
        }
        return isvalidUserName;

    }

    public boolean validateData() {

        if (isValidFirstName && isValidLasttName &&!passwordTextF.getText().isEmpty() && isvalidUserName && isValidEMail) {
            isValidData = true;
        }
        return isValidData;

    }

    public void validatePassword(String passFromForm) {
        isValidPassord = true;
        LengthRule lengthRule = new LengthRule(8, 16);

// don't allow whitespace
        WhitespaceRule whitespaceRule = new WhitespaceRule();

// control allowed characters
        CharacterCharacteristicsRule charRule = new CharacterCharacteristicsRule();
// require at least 1 digit in passwords
        charRule.getRules().add(new DigitCharacterRule(1));
// require at least 1 non-alphanumeric char
        charRule.getRules().add(new NonAlphanumericCharacterRule(1));
// require at least 1 upper case char
        charRule.getRules().add(new UppercaseCharacterRule(1));
// require at least 1 lower case char
        charRule.getRules().add(new LowercaseCharacterRule(1));
// require at least 3 of the previous rules be met
        charRule.setNumberOfCharacteristics(3);

// don't allow alphabetical sequences
        AlphabeticalSequenceRule alphaSeqRule = new AlphabeticalSequenceRule();

// don't allow numerical sequences of length 3
        NumericalSequenceRule numSeqRule = new NumericalSequenceRule(3, true);

// don't allow qwerty sequences
        QwertySequenceRule qwertySeqRule = new QwertySequenceRule();

// don't allow 4 repeat characters
        RepeatCharacterRegexRule repeatRule = new RepeatCharacterRegexRule(4);

// group all rules together in a List
        List<Rule> ruleList = new ArrayList<Rule>();
        ruleList.add(lengthRule);
        ruleList.add(whitespaceRule);
        ruleList.add(charRule);
        ruleList.add(alphaSeqRule);
        ruleList.add(numSeqRule);
        ruleList.add(qwertySeqRule);
        ruleList.add(repeatRule);

        PasswordValidator validator = new PasswordValidator(ruleList);
        PasswordData passwordData = new PasswordData(new Password(passFromForm));

        RuleResult result = validator.validate(passwordData);
        if (result.isValid()) {
            System.out.println("*******Valid password******");
        } else {
                                isValidPassord = false;

            //passwordLabel.setForeground(Color.red);
            for (String msg : validator.getMessages(result)) {
//                if ("Password must at least 8 characters in length.".equals(msg)) {
////                    isValidPassord = false;
//                }

                System.out.println(msg);
            }
        }
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        lastNameLabel = new javax.swing.JLabel();
        EMailLabel = new javax.swing.JLabel();
        userNameLabel = new javax.swing.JLabel();
        passwordLabel = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        countryCombo = new javax.swing.JComboBox();
        genderCombo = new javax.swing.JComboBox();
        lastNameTextF = new javax.swing.JTextField();
        EMailTextF = new javax.swing.JTextField();
        userNameTextF = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        passwordTextF = new javax.swing.JPasswordField();
        strengthLabel = new javax.swing.JLabel();
        passwordMeter = new javax.swing.JProgressBar();
        firstNameLabel = new javax.swing.JLabel();
        firstNameTextF = new javax.swing.JTextField();
        EmailWarningLabel = new javax.swing.JLabel();
        WeakStrongLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Regiter");
        setResizable(false);

        jPanel1.setForeground(new java.awt.Color(255, 0, 102));
        jPanel1.setName("regPanel"); // NOI18N

        lastNameLabel.setText("Last Name:");

        EMailLabel.setText("E-Mail:");
        EMailLabel.setName("EMailLabel"); // NOI18N

        userNameLabel.setText("UserName:");

        passwordLabel.setText("Password:");

        jLabel6.setText("Country:");

        jLabel7.setText("Gender:");

        countryCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Egypt ", "Andorra ", "United Arab Emirates ", "Afghanistan ", "Antigua and Barbuda ", "Anguilla ", "Albania ", "Armenia ", "Netherlands Antilles ", "Angola ", "Antarctica ", "Argentina ", "American Samoa ", "Austria ", "Australia ", "Aruba ", "Åland Islands ", "Azerbaijan ", "Bosnia and Herzegovina ", "Barbados", "Bangladesh ", "Belgium", "Burkina Faso ", "Bulgaria ", "Bahrain ", "Burundi", "Benin ", "Saint Barthélemy ", "Bermuda", "Brunei ", "Bolivia ", "British Antarctic Territory", "Brazil ", "Bahamas ", "Bhutan", "Bouvet Island ", "Botswana ", "Belarus ", "Belize ", "Canada ", "Cocos [Keeling] Islands ", "Congo - Kinshasa ", "Central African Republic ", "Congo - Brazzaville ", "Switzerland ", "Côte d’Ivoire ", "Cook Islands ", "Chile ", "Cameroon ", "China ", "Colombia", "Costa Rica ", "Serbia and Montenegro ", "Canton and Enderbury Islands", "Cuba ", "Cape Verde ", "Christmas Island ", "Cyprus ", "Czech Republic ", "East Germany ", " " }));

        genderCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female" }));

        jButton1.setText("Sign Up");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Cancel");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        strengthLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        strengthLabel.setText("Strength:");

        firstNameLabel.setText("First Name:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lastNameLabel)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(firstNameLabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(firstNameTextF, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(EMailLabel)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jButton1)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel7))
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(genderCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(countryCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                        .addContainerGap(52, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(passwordLabel)
                            .addComponent(userNameLabel)
                            .addComponent(strengthLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(passwordMeter, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(userNameTextF, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                                    .addComponent(passwordTextF, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(EMailTextF, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                                    .addComponent(lastNameTextF, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                                    .addComponent(EmailWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(WeakStrongLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                                .addContainerGap())))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(firstNameLabel)
                    .addComponent(firstNameTextF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lastNameTextF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lastNameLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EMailLabel)
                    .addComponent(EMailTextF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(EmailWarningLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(userNameTextF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(userNameLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(passwordTextF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(passwordLabel)
                    .addComponent(WeakStrongLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(strengthLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(passwordMeter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(genderCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(countryCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addGap(26, 26, 26))
        );

        strengthLabel.getAccessibleContext().setAccessibleName("Strength");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        int i = 0;
        this.validateFirstName(firstNameTextF.getText());
        this.validateEmail(EMailTextF.getText());
        this.ValideUserName(userNameTextF.getText());
        this.validateLastName(lastNameTextF.getText());
        this.validateData();

        if (!isValidFirstName) {
            lastNameLabel.setForeground(Color.red);
        }
        if (!isValidEMail) {
            EMailLabel.setForeground(Color.red);
        }
       
        if (!isvalidUserName) {
            userNameLabel.setForeground(Color.red);
        }
        if (!isValidLasttName) {
            lastNameLabel.setForeground(Color.red);
        }
        if (!isValidFirstName) {
            firstNameLabel.setForeground(Color.red);
        }
        if(passwordTextF.getText().isEmpty()){
        passwordLabel.setForeground(Color.red);
        }

        if (isValidData) {

            Account account = new Account(firstNameTextF.getText(),
                    lastNameTextF.getText(), EMailTextF.getText(), passwordTextF.getText(),
                    genderCombo.getSelectedItem().toString(), countryCombo
                    .getSelectedItem().toString());
            boolean isAccountExist = false;
            try {
                isAccountExist = ClientController.getService().checkExistingAccout(account);
            } catch (RemoteException e1) {
                e1.printStackTrace();
            }

            if (isAccountExist) {
                EmailWarningLabel.setText("Already Existing Account");
                EmailWarningLabel.setForeground(Color.red);
                isAccountExist = false;
                // System.out.println("Already Exist");
            } else {
                try {
                    if (ClientController.getService().signUp(account)) {
                        System.out.println("Account Added");
                        Boolean ret = ClientController.getService().sendMail(account);
                        this.dispose();
                    } else {
                        System.err.println("Account did not added");
                    }

                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    }//GEN-LAST:event_jButton2ActionPerformed

    public static void main(String args[]) {

        try {
            UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel");

//            UIManager.setLookAndFeel(
//            UIManager.getCrossPlatformLookAndFeelClassName());
            //           UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); //vry good

        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                Register frame = new Register();
                frame.setVisible(true);


            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel EMailLabel;
    private javax.swing.JTextField EMailTextF;
    private javax.swing.JLabel EmailWarningLabel;
    private javax.swing.JLabel WeakStrongLabel;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JComboBox countryCombo;
    private javax.swing.JLabel firstNameLabel;
    private javax.swing.JTextField firstNameTextF;
    private javax.swing.JComboBox genderCombo;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lastNameLabel;
    private javax.swing.JTextField lastNameTextF;
    private javax.swing.JLabel passwordLabel;
    javax.swing.JProgressBar passwordMeter;
    private javax.swing.JPasswordField passwordTextF;
    private javax.swing.JLabel strengthLabel;
    private javax.swing.JLabel userNameLabel;
    private javax.swing.JTextField userNameTextF;
    // End of variables declaration//GEN-END:variables
}
